﻿@using Hybrid.Quartz.Dashboard.Models.Dtos
@model Hybrid.Quartz.Dashboard.Views.Shared.Components.TopBarSchedulerSwitch.TopBarSchedulerSwitchViewModel

@if (Model.SchedulerHeaders.Count > 1)
{
    <li class="dropdown">
        <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button">
            <i title="@Model.CurrentSchedulerHeader.Name"></i>
            <span>@Model.CurrentSchedulerHeader.Name</span>
            <b class="caret"></b>
            <input type="hidden" id="scheduler" value="@Model.CurrentSchedulerHeader.Name" />
        </a>

        <ul class="dropdown-menu pull-right">
            @foreach (SchedulerHeaderDto scheduler in Model.SchedulerHeaders)
            {
                if (scheduler.Name != Model.CurrentSchedulerHeader.Name)
                {
                    <li><a href="@(ApplicationPath)Quartz/Scheduler/ChangeScheduler?schedulerName=@(scheduler.Name)&returnUrl=@(Context.Request.Path + Context.Request.QueryString.Value)">@scheduler.Name</a></li>
                }
            }
        </ul>
    </li>
}